#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "Tree.h"
#include "Graph.h"
#include <sstream>
#include <iostream>
using namespace std;

Tree::Tree()
{
}

Tree::Tree(int taille)
{
  srand(time(NULL));
  if (taille < 1)
    return;

  int courant;
  int i = courant =addVertex();
  int nbFils;

  while (i < taille-1) 
    {
      nbFils = rand() % (taille-i);
      if(nbFils == 0)
	i=addVertex();
      for (int j = 0; j < nbFils; j++)
	{
	  i=addVertex();
	  addEdge(courant, i);
	}
      courant++;
    }
}
